<div id="content">
     <h2>CALENDER FOR: <?php echo $this->currendate;?><span id="datelist"></span></h2>
<div class="clear"></div>
</div> 
<div id="content">
    <?php
        $length = count($this->dateTemplate);
        $item = $this->dateTemplate;
        for($i=0; $i<$length-1;$i++): 
            $startTime = new Zend_Date($item[$i],Zend_Date::YEAR."-".Zend_Date::MONTH."-".Zend_Date::DAY." ".Zend_Date::HOUR.":".Zend_Date::MINUTE.":".Zend_Date::SECOND);
            $endTime = new Zend_Date($item[$i+1],Zend_Date::YEAR."-".Zend_Date::MONTH."-".Zend_Date::DAY." ".Zend_Date::HOUR.":".Zend_Date::MINUTE.":".Zend_Date::SECOND);

        ?>
        <div>
            <h2 style="text-align: center;background-color: #999;padding: 5px;color: white"><?php echo $startTime->get(Zend_Date::HOUR.":".Zend_Date::MINUTE) ?> -> <?php echo $endTime->get(Zend_Date::HOUR.":".Zend_Date::MINUTE) ?></h2>
            <table style="color: black;font-size: 14px;font-weight: bold" width="100%" cellpadding="0" cellspacing="0" border="1">
            <tbody>
            <?php 
                   $k = 1;
                  foreach($this->list as $list) :
                  if($list->start_time >= $item[$i] && $list->start_time <$item[$i+1]):
            ?>
               <tr <?php echo $k++%2==0?"style=\"background-color: #EEEEEE\"":"" ?>>
                <td style="padding: 3px;" width="30%"><?php echo $list->customer_fname." ".$list->customer_lname ?></td>
                <td style="padding: 3px;" width="30%"><?php echo $list->services_name ?></td>
                <td style="padding: 3px;" width="30%"><?php echo $list->employee_name ?></td>
               </tr>
               <?php endif; ?>
           <?php endforeach; ?>
               
            </tbody>
            </table>
        </div>
        <br>

    <?php endfor; ?>
    
<div class='clear'></div>
</div> 

